﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sealight.Core.Common;

namespace Sealight.Core.Domain
{
   public class ShoppingCartItemEntity:BaseEntity
    {
        /// <summary>
        /// Gets or sets the shopping cart item identifier
        /// </summary>
        public virtual Guid ShoppingCartItemID { get; set; }
        
        /// <summary>
        /// Gets or sets the product variant attribute
        /// </summary>
        public  virtual string Attributes { get; set; }

        /// <summary>
        /// Gets or sets the quantity
        /// </summary>
        public virtual int Quantity { get; set; }

        /// <summary>
        /// Gets or sets the date and time of instance creation
        /// </summary>
        public virtual DateTime CreatedDate { get; set; }

        /// <summary>
        /// Gets or sets the date and time of instance update
        /// </summary>
        public virtual DateTime ModifiedDate { get; set; }
        /// <summary>
        /// Gets or sets the shopping cart type identifier
        /// </summary>
        public virtual ShoppingCartType ShoppingCartType { get; set; }

        /// <summary>
        /// Gets or sets the customer session identifier
        /// </summary>
        public virtual UserSessionEntity UserSession { get; set; }

        /// <summary>
        /// Gets or sets the product variant identifier
        /// </summary>
        public virtual ProductVariantEntity ProductVariant { get; set; }

        public virtual Sealight.Core.DataAdapter.shopping_cart_item ToDataAdapter()
        {
            return new DataAdapter.shopping_cart_item {id = this.ShoppingCartItemID, attributes=this.Attributes, created_date=this.CreatedDate, modified_date=this.ModifiedDate, quantity = this.Quantity 
            , shopping_cart_type = this.ShoppingCartType, user_session = this.UserSession.ToDataAdapter(), product_variant=this.ProductVariant.ToDataAdapter()};
        }
    }
}
